<?php
$this->title = '个人信息变更';
?>
<div class="m-remark">
    <em contenteditable="true" id="param"><?php
        $param = yii::$app->request->get();
        $key = '';
        foreach($param as $k => $item){
            echo $item;
            $key = $k;
            break;
        }
        ?></em>
    <a href="javascript:update('<?= $key?>');"><span>确定</span></a>
</div>

<script>
    function update(key){
//        console.log(key);
        var val = $('#param').text();
//        console.log(val);
        $.ajax({
            type: "get",
            dataType: "json",
            async: true,
            url: "/web/user/update?" + key + "=" + val,
            success: function (data) {
                window.location.href = '/web/user';
            },
            error: function (data) {
                alert(data);
            }
        });
    }
</script>